<script setup lang="ts">
import { ref, nextTick } from "vue";
import { formRules } from "../utils/rule";
import { FormProps } from "../utils/types";

const props = withDefaults(defineProps<FormProps>(), {
  formInline: () => ({
    id: "",
    unitName: ""
  })
});

const ruleFormRef = ref();
const newFormInline = ref(props.formInline);

function getRef() {
  return ruleFormRef.value;
}

defineExpose({ getRef });
</script>

<template>
  <el-form
    ref="ruleFormRef"
    :model="newFormInline"
    :rules="formRules"
    label-width="100px"
    class="mr-8"
  >
    <el-form-item label="单位" prop="unitName">
      <el-input
        v-model="newFormInline.unitName"
        clearable
        placeholder="请输入单位"
      />
    </el-form-item>
  </el-form>
</template>
